//
// Created by edward on 23-3-16.
//

#ifndef LEARNOPENGL_SHADER_H
#define LEARNOPENGL_SHADER_H


#include "global.h"
#include <string>
#include <fstream>
#include <sstream>
#include <iostream>


class Shader {
public:
    // the program ID
    unsigned int ID;

    // constructor reads and builds the shader
    Shader(const char* vertexPath, const char* fragmentPath);
    ~Shader();
    // use/activate the shader
    void use();
    // utility uniform functions
    void set(const std::string &name, bool value) const;
    void set(const std::string &name, int value) const;
    void set(const std::string &name, float value) const;
    void set(const std::string &name, const glm::vec4& value) const;
    void set(const std::string &name, const glm::mat4& value) const;
    void set(const std::string &name, const glm::mat3& value) const;
    void set(const std::string &name, const glm::vec3& value) const;
    void get(const std::string &name, glm::mat3 &value) const;
    void get(const std::string &name, glm::mat4 &value) const;


    void setModelMatrix(const glm::mat4& mtx) const ;
    void setViewMatrix(const glm::mat4& mtx) const ;
    void setProjectionMatrix(const glm::mat4& mtx) const ;
};


#endif //LEARNOPENGL_SHADER_H
